package p270jp.pxv.android.viewholder;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import p062c4.ViewBindings;
import p156ff.SeeReplies;
import p165fo.C3114c;
import p216hn.DefaultConstructorMarker;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.CommentListActivity;
import p270jp.pxv.android.event.ClickSeeRepliesEvent;
import p270jp.pxv.android.legacy.model.PixivWork;
import p314lg.ViewHolderNestedCommentSeeRepliesBinding;
import p325m0.MutabilityOwnership;

/* compiled from: SeeRepliesViewHolder.kt */
/* renamed from: jp.pxv.android.viewholder.SeeRepliesViewHolder */
/* loaded from: classes2.dex */
public final class SeeRepliesViewHolder extends NestedCommentViewHolder {
    private final ViewHolderNestedCommentSeeRepliesBinding binding;
    public static final Companion Companion = new Companion(null);
    public static final int $stable = 8;

    /* compiled from: SeeRepliesViewHolder.kt */
    /* renamed from: jp.pxv.android.viewholder.SeeRepliesViewHolder$Companion */
    /* loaded from: classes2.dex */
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(DefaultConstructorMarker eVar) {
            this();
        }

        public final SeeRepliesViewHolder createViewHolder(ViewGroup viewGroup) {
            MutabilityOwnership.m3745m(viewGroup, "viewGroup");
            View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.view_holder_nested_comment_see_replies, viewGroup, false);
            TextView textView = (TextView) ViewBindings.m9835b(inflate, R.id.see_replies_button);
            if (textView != null) {
                return new SeeRepliesViewHolder(new ViewHolderNestedCommentSeeRepliesBinding((LinearLayout) inflate, textView), null);
            }
            throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(R.id.see_replies_button)));
        }
    }

    private SeeRepliesViewHolder(ViewHolderNestedCommentSeeRepliesBinding o7Var) {
        super(o7Var.f22047a);
        this.binding = o7Var;
    }

    public /* synthetic */ SeeRepliesViewHolder(ViewHolderNestedCommentSeeRepliesBinding o7Var, DefaultConstructorMarker eVar) {
        this(o7Var);
    }

    /* renamed from: onBind$lambda-0 */
    public static final void m12335onBind$lambda0(boolean z, SeeRepliesViewHolder seeRepliesViewHolder, PixivWork pixivWork, SeeReplies eVar, View view) {
        MutabilityOwnership.m3745m(seeRepliesViewHolder, "this$0");
        MutabilityOwnership.m3745m(pixivWork, "$work");
        MutabilityOwnership.m3745m(eVar, "$seeReplies");
        if (z) {
            Context context = seeRepliesViewHolder.itemView.getContext();
            MutabilityOwnership.m3746l(context, "itemView.context");
            int i = eVar.f14535a;
            Intent intent = new Intent(context, CommentListActivity.class);
            intent.putExtra("WORK", pixivWork);
            intent.putExtra("COMMENT_ID_FOR_AUTO_OPEN_REPLY_LIST", i);
            seeRepliesViewHolder.itemView.getContext().startActivity(intent);
            return;
        }
        eVar.f14537c = false;
        seeRepliesViewHolder.binding.f22048b.setEnabled(false);
        C3114c.m6284b().m6280f(new ClickSeeRepliesEvent(pixivWork, eVar));
    }

    public final void onBind(SeeReplies eVar, PixivWork pixivWork, boolean z) {
        MutabilityOwnership.m3745m(eVar, "seeReplies");
        MutabilityOwnership.m3745m(pixivWork, "work");
        this.binding.f22048b.setEnabled(eVar.f14537c);
        if (eVar.f14536b && eVar.f14538d == null) {
            this.binding.f22048b.setVisibility(8);
            return;
        }
        this.binding.f22048b.setVisibility(0);
        if (eVar.f14536b) {
            this.binding.f22048b.setText(R.string.comment_replylist_viewmore);
        } else {
            this.binding.f22048b.setText(R.string.comment_replylist_open);
        }
        this.binding.f22048b.setOnClickListener(new View.OnClickListener(z, this, pixivWork, eVar) { // from class: jp.pxv.android.viewholder.k

            /* renamed from: a */
            public final /* synthetic */ boolean f19766a;

            /* renamed from: b */
            public final /* synthetic */ SeeRepliesViewHolder f19767b;

            /* renamed from: c */
            public final /* synthetic */ PixivWork f19768c;

            /* renamed from: d */
            public final /* synthetic */ SeeReplies f19769d;

            {
                this.f19766a = r1;
                this.f19767b = r2;
                this.f19768c = r3;
                this.f19769d = r4;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                SeeRepliesViewHolder.m12335onBind$lambda0(this.f19766a, this.f19767b, this.f19768c, this.f19769d, view);
            }
        });
    }
}
